# Contributor: Fabian Affolter <fabian@affolter-engineering.ch>
# Maintainer: Celeste <cielesti@protonmail.com>
maintainer="Celeste <cielesti@protonmail.com>"
pkgname=irclog2html
pkgver=4.0.0
pkgrel=0
pkgdesc="Convert IRC logs to HTML and other formats"
url="https://mg.pov.lt/irclog2html/"
arch="noarch"
license="GPL-2.0-or-later"
makedepends="py3-gpep517 py3-setuptools py3-wheel"
checkdepends="py3-pytest"
subpackages="$pkgname-pyc"
source="https://github.com/mgedmin/irclog2html/archive/refs/tags/$pkgver/irclog2html-$pkgver.tar.gz"

build() {
	gpep517 build-wheel \
		--wheel-dir .dist \
		--output-fd 3 3>&1 >&2
}

check() {
	python3 -m venv --clear --without-pip --system-site-packages .testenv
	.testenv/bin/python3 -m installer .dist/*.whl
	.testenv/bin/python3 -m pytest
}

package() {
	python3 -m installer -d "$pkgdir" .dist/*.whl
	install -Dpm 0644 src/$pkgname/irclog.css \
		"$pkgdir"/usr/share/$pkgname/irclog.css
}

sha512sums="
199a97e351a1b37bdef4adbf298305df25e4f0c15a12c254dd906af2d08f472e1ddfbc847bf119fdb81679df8eed9554a664380a375494d708a9bff6d96a9bec  irclog2html-4.0.0.tar.gz
"
